<template>
  <el-container class="homePageBox">
    <el-aside
      :width="isCollapse ? '64px' : '200px'"
      height="100vh"
      class="homeAside"
      style="background: red"
    >
      <el-menu
        class="el-menu-vertical-demo homeMenuList"
        default-active="2"
        text-color="rgb(191, 203, 217)"
        background-color="#304156"
        :unique-opened="true"
        :collapse="isCollapse"
        :collapse-transition="false"
        router
      >
        <el-submenu
          v-for="(item, index) in meauList"
          :key="index"
          :index="index + '1'"
        >
          <template slot="title">
            <i :class="item.icon"></i>
            <span slot="title">{{ item.name }}</span>
          </template>
          <el-menu-item-group>
            <el-menu-item
              v-for="(itemChild, indexChild) in item.children"
              :key="indexChild"
              :index="itemChild.path"
            >
              <i :class="itemChild.icon"></i>
              <span slot="title">{{ itemChild.name }}</span>
            </el-menu-item>
          </el-menu-item-group>
        </el-submenu>
      </el-menu>
    </el-aside>
    <el-main class="homeMain">
      <el-container>
        <el-header class="homeMainHeader">
          <div class="homeMainHeaderTop">
            <div>
              <div class="homeLeft">
                <i
                  class="isCollapseIcon"
                  :class="isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'"
                  @click="isCollapseFn()"
                ></i>
                <span>首页</span>
              </div>
              <div class="homeRight">
                <img
                  class="homeUserIcon"
                  src="static/avatar.ecba1844.gif"
                  alt=""
                />
                <i class="el-icon-caret-bottom"></i>
              </div>
            </div>
          </div>
          <div class="homeCrumbsList"></div>
        </el-header>
        <el-main class="homeMainMain">
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-main>
  </el-container>
</template>
<script>
export default {
  name: "home",
  mounted() {
    let _self = this;
    // console.log(_self.$route);
    // query传参
    // 下一个页面接参
    // console.log(_self.$route.query.Lname);
    // console.log(_self.$route.query.Bname);
  },
  data() {
    return {
      isCollapse: false,
      activeIndex: "1",
      activeIndex2: "1",
      charts: "",
      opinionData: ["3", "2", "4", "4", "5"],
      meauList: [
        {
          path: "/dashboard",
          name: "首页",
          icon: "iconfont icon-home-line",
          children: [
            {
              path: "/dashboard",
              name: "控制台",
              icon: "iconfont icon-yibiaopan",
            },
          ],
        },
        {
          path: "/ShopManagement",
          name: "商城管理",
          icon: "iconfont icon-shangcheng",
          children: [
            {
              path: "/ShopManagement/CommodityManagement",
              icon: "iconfont icon-geren",
              name: "会员管理",
            },
            {
              path: "/ShopManagement/CommodityClassification",
              icon: "iconfont icon-01_shangpinfenlei",
              name: "商品类别",
            },
            {
              path: "/ShopManagement/CommoditySpecification",
              icon: "iconfont icon-5gouwudai2",
              name: "商品管理",
            },
            {
              path: "/ShopManagement/CommodityReview",
              icon: "iconfont icon-dingdan",
              name: "订单管理",
            },
            {
              path: "/ShopManagement/ShopCart",
              icon: "iconfont icon-ai66",
              name: "购物车",
            },
            {
              path: "/ShopManagement/BannerManagement",
              icon: "iconfont icon-guanggao",
              name: "banner管理",
            },
            {
              path: "/ShopManagement/FavoritesList",
              icon: "iconfont icon-shoucang",
              name: "收藏列表",
            },
            {
              path: "/ShopManagement/FileStore",
              icon: "iconfont icon-wenjianjia-",
              name: "文件存储",
            },
          ],
        },
        {
          path: "/PromotionManagement",
          icon: "iconfont icon-laba",
          name: "推广管理",
          children: [
            {
              path: "/PromotionManagement/ThematicManagement",
              icon: "iconfont icon-pinpai",
              name: "专题管理",
            },
          ],
        },
        {
          path: "/CMSManagement",
          icon: "iconfont icon-file-txt-fill",
          name: "CMS管理",
          children: [
            {
              path: "/CMSManagement/ColumnManagement",
              icon: "iconfont icon-houtaiguanli-lanmuguanli",
              name: "栏目管理",
            },
            // {
            //   path: "/CMSManagement/EditPost",
            //   icon: "iconfont icon-bianji",
            //   name: "编辑文章",
            // },
            {
              path: "/CMSManagement/ArticleManagement",
              icon: "iconfont icon-file-txt-fill",
              name: "文章管理",
            },
            {
              path: "/CMSManagement/InvitationManagement",
              icon: "iconfont icon-24gf-telephone2",
              name: "邀请管理",
            },
          ],
        },
        {
          path: "/SystemManagement",
          icon: "iconfont icon-shezhi",
          name: "系统管理",
          children: [
            {
              path: "/SystemManagement/UserManagement",
              icon: "iconfont icon-geren",
              name: "用户管理",
            },
            {
              path: "/SystemManagement/RoleManagement",
              icon: "iconfont icon-duoren",
              name: "角色管理",
            },
            // {
            //   path: "/SystemManagement/DepartmentManagement",
            //   icon: "iconfont icon-bumen",
            //   name: "部门管理",
            // },
            {
              path: "/SystemManagement/MenuManagement",
              icon: "iconfont icon-lianxi2hebing_caidan",
              name: "菜单管理",
            },
            {
              path: "/SystemManagement/DictionaryManagement",
              icon: "iconfont icon-zidianguanli",
              name: "字典管理",
            },
            {
              path: "/SystemManagement/PhysicalDistributionManagement",
              icon: "iconfont icon-wuliukuaidi",
              name: "物流管理",
            },
            {
              path: "/SystemManagement/ParameterManagement",
              icon: "iconfont icon-_canshu_xiugaicanshudingyi",
              name: "参数管理",
            },
            {
              path: "/SystemManagement/TaskManagement",
              icon: "iconfont icon-renwu-",
              name: "任务管理",
            },
          ],
        },
        {
          path: "/MessageManagement",
          icon: "iconfont icon-xiaoxi",
          name: "消息管理",
          children: [
            {
              path: "/MessageManagement/HistoricalMessages",
              icon: "iconfont icon-xiaoxi",
              name: "历史消息",
            },
            // {
            //   path: "/MessageManagement/MessageTemplate",
            //   icon: "iconfont icon-xiaoximoban",
            //   name: "消息模板",
            // },
            {
              path: "/MessageManagement/MessageSender",
              icon: "iconfont icon-7",
              name: "消息发送器",
            },
          ],
        },
        {
          path: "/MochaITOM",
          icon: "iconfont icon-maintenance",
          name: "运维管理",
          children: [
            {
              path: "/MochaITOM/MonitoringManagement",
              icon: "iconfont icon-yunliankeji-",
              name: "监控管理",
            },
            {
              path: "/MochaITOM/InterfaceDocument",
              icon: "iconfont icon-jiekoupeizhi",
              name: "接口文档",
            },
            {
              path: "/MochaITOM/BusinessLog",
              icon: "iconfont icon-rizhi",
              name: "业务日志",
            },
            {
              path: "/MochaITOM/LoginLog",
              icon: "iconfont icon-guanlidenglurizhi",
              name: "登录日志",
            },
          ],
        },
      ],
      multipleSelection: [],
    };
  },
  methods: {
    isCollapseFn() {
      let _self = this;
      _self.isCollapse = !_self.isCollapse;
    },
  },
};
</script>
<style>
.homeMenuList {
  position: fixed;
  z-index: 99;
  height: 100%;
  border-style: none;
}
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
}
.homeMain {
  padding: 0;
}
.homeMainHeader {
  position: fixed;
  z-index: 99;
  width: 100%;
  padding: 0;
  height: 84px !important;
  background-color: #ffffff;
  border-bottom: 1px solid rgb(191, 203, 217);
  box-sizing: border-box;
}
.homeMainHeaderTop {
  height: 50px;
  line-height: 50px;
  border-bottom: 1px solid rgb(246, 246, 246);
}
.homeLeft {
  float: left;
}
.homeRight {
  float: right;
  transform: translateX(-210px);
}
.isCollapseIcon {
  font-size: 20px;
  padding: 0 15px;
}
.homeUserIcon {
  cursor: pointer;
  padding: 5px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
.homeMainMain {
  margin-top: 84px;
  padding: 0px;
}
</style>
